a,b=input().split(",",1)
print(int(a,int(b)))